User Profile Batch Upload
The User Profile Batch Upload allows you to load and update multiple user profiles simultaneously. It provides a way to store user attribute information and can load customer segments, attributes, user linkings, or user preferences into the User Profile Service. This data then becomes available for use with the Algonomy Personalization Cloud. When a batch file is processed, any existing data for a user in the new file is replaced with the data from the file. Users not contained in the file remain unchanged.
By uploading a batch of users and user attributes, segments, user linkings, and preferences that you have already identified, you can start benefiting from UPS more quickly.
This topic covers one method of importing data into the User Profile Service. It is intended for anyone considering implementing User Profiles as part of their Omni-channel Personalization integration, as well as Algonomy employees, partners, and new users of the Service.
How It Works
Full Feed and Delta Feed
The JSON data file is uploaded via FTP. Personalization Cloud supports both full and incremental (delta) types of Batch Upload. You can find more information regarding the differences between Full Feed and Delta Feed here.
Batch File
File Format
The file is a simple JSON data file. Each individual object in the file will have two fields: ‘userId’ and ‘value’. 'userId' is the user profile to attach the data to, and 'value' is the JSON object that will be returned from that ID upon request.
Note: Only data uploaded as segments can be used in the dashboard segment builder and merchandising rules, user attributes can only be stored in the UPS.
Here’s an example of what this may look like for user segment data.
{“userId”: “13579”, “value”: {“seg2134″: ”Dog Owner”, “seg50plus”: ”High Spender”, “Platinum”: “Platinum Member”}}
{“userId”: “bob789″, “value”: {“seg345″: ”Cat Owner”}}
{“userId”: “jill456″, “value”: {“seg345″: ”Cat Owner”, ”silver”: ”Silver Loyalty Member”}}
Another example that loads data for user preferences would look like
{“userId”: “john123″, ”value”: {“like”: [“prod102710186″, ”prod102480209″, ”prod100800220″, ”prod101000082″], ”disLike”: [“prod10150001″, ”prod101010003″, ”prod00780″, ”prod102540091″, ”prod101910083″, ”prod101520076″]}}
{“userId”: “jill456″, ”value”: {“like”: [“prod102710186″,”prod102480209″], ”disLike”: []}}
{“userId”: “joe345″, ”value”: {“like”: [“prod102710186″], ”disLike”: [“prod102480209″]}}
Another example that loads data for user attributes would look like
{“userId”: “john123″, ”value”: {"haircolor": ["brown", "black"], "eyecolor": ["green"]}}
{“userId”: “jill456″, ”value”: {"haircolor": ["grey"], "eyecolor": ["blue"]}}
{“userId”: “joe345″, ”value”: {"haircolor": ["blonde"], "eyecolor": ["blue"]}}
Note: Each attribute type (attributes or preferences) must be loaded as a separate file into UPS.
Uploading File
To upload the batch attributes into the User Profile, you need to load the file onto the Build FTP site and run the “UPSBATCH” operation. The “-attribute” argument is required to define the type of customer attribute that is being stored in the User Profile. For Algonomy applications to recognize these attributes properly, we have defined a few restricted attribute options. When uploading information that is utilized by another Algonomy application, please use the proper customer attribute option. An example would be for uploading customer segment information that can be used across applications. We assign “rr-segments” for it to be recognized and used by the relevant applications.
ftp build-ftp.richrelevance.com 2222
put ~/sample_segments.txt sample_segments.txt
site upsbatch sample_segments.txt -attribute rr-segments
Each time a new file is uploaded for the same attributes and users, we overwrite the previous data associated with the users.
For example, assume you had originally provided user preference data to say User-A likes {product 1, product 2}. Then if in a subsequent update, you provide us User-A likes {product 3, product 4}, then the response from the User Profile Service would indicate User-A likes {product 3, product 4} and not {product 1, product 2}.
The restricted attribute options when uploading batch data are as follows:
rr-segments: Used to define a list of segments for each user
rr-userattributes: Used to define a list of user attributes for each user
rr-preferences: Used to define a list of user preferences for each user.
Each of these must be loaded as separate files into UPS.
Note: There is a configuration that needs to be enabled for batch uploads for UPS. Please inform your Algonomy representative to enable this for you.
User Profile Response
When using the User Profile API to get data about a specific user, the batch uploaded data for that user is returned under a “batchAttribute” section, as shown in the example below.
"batchAttributes": {
"john123": {
"rr-segments": [
{"seg123": "Dog Owner"},
{"platinum": "Platinum Loyalty Member"}
],
"rr-preferences": {
'like': [prod102710186,prod102480209,prod100800220,prod101000082],
'disLike': [prod10150001,prod101010003,prod00780,prod102540091,prod101910083,prod101520076]
}
}
}